<template>
  <div class="p-15 p-t-0">
    <div class="table-padding orderDialog">
      <el-form :model="modelForm" ref="modelForm">
        <div>
          <el-row>
            <el-col :span="8">
              <el-form-item prop="supplier" :rules="[]">
                <div class="el-input el-input-group el-input-group--prepend">
                  <div class="el-input-group__prepend">供应商</div>
                  <el-select v-model="modelForm.supplierId" size="medium" filterable placeholder="请选择供应商"
                             :disabled="isEdit" style="width: 100%">
                    <el-option
                      v-for="item in suppliers"
                      :key="item.id"
                      :label="item.name"
                      :disabled="(item.state && item.state.key!='NORMAL')"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </div>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="no" :rules="[]">
                <div class="el-input el-input-group el-input-group--prepend">
                  <div class="el-input-group__prepend">订单日期</div>
                  <el-date-picker size="medium"
                                  v-model="modelForm.purchaseTime"
                                  type="date"
                                  style="width: 100%"
                                  format="yyyy-MM-dd"
                                  value-format="yyyy-MM-dd"
                                  placeholder="选择日期"
                                  :readonly="true"
                  >
                  </el-date-picker>
                </div>
              </el-form-item>
            </el-col>
            <el-col :span="8">
              <el-form-item prop="no" :rules="[]">
                <div class="el-input el-input-group el-input-group--prepend">
                  <div class="el-input-group__prepend">收货日期</div>
                  <el-date-picker size="medium"
                                  v-model="modelForm.acceptTime"
                                  type="date"
                                  style="width: 100%"
                                  format="yyyy-MM-dd"
                                  value-format="yyyy-MM-dd"
                                  placeholder="选择日期"
                  >
                  </el-date-picker>
                </div>
              </el-form-item>
            </el-col>

          </el-row>
          <el-row>

            <el-col :span="8">
              <el-form-item  prop="supplier" :rules="[]" >
                <div class="el-input el-input-group el-input-group--prepend">
                  <div class="el-input-group__prepend">商品信息库</div>
                  <el-select v-model="modelForm.storeId" filterable placeholder="请选择商品信息库" :disabled="true" style="width: 100%">
                    <el-option
                      v-for="item in storeList"
                      :key="item.id"
                      :label="item.name"
                      :disabled="item.state!='NORMAL'"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </div>
              </el-form-item>
            </el-col>

            <el-col :span="8">
              <!--确认收货的时候 选择入库仓库-->
            <el-form-item  prop="supplier" :rules="[]" >
                <div class="el-input el-input-group el-input-group--prepend">
                  <div class="el-input-group__prepend">入库仓库</div>
                  <el-select v-model="modelForm.warehouseId" filterable placeholder="请选择入库仓库" :disabled="isEdit" style="width: 100%" size="medium">
                    <el-option
                      v-for="item in warehouses"
                      :key="item.id"
                      :label="item.name"
                      :disabled="(item.state && item.state.key!='NORMAL')"
                      :value="item.id">
                    </el-option>
                  </el-select>
                </div>
              </el-form-item>
          </el-col>

            <el-col :span="8">

            </el-col>
          </el-row>
        </div>
        <div >
          <el-form-item class="text-left text-left1">
            <el-button size="medium" class="m-l-0" type="success" @click="resetForm('modelForm')"><i
              class="icon icon-tijiao"></i> 确认收货
            </el-button>
            <!--<el-button size="medium" type="warning" v-if="modelForm.id" @click="printOrder"><i-->
            <!--class="icon icon-dayin"></i> 打印-->
            <!--</el-button>-->
            <el-button size="medium" type="danger" @click="goBack()"><i class="icon icon-fanhui1"></i> 取消</el-button>
          </el-form-item>
          <div class="orderTable">

          <el-table
            :data="tableData"
            border
            show-summary
            :summary-method="getSummaries"
            style="width: 100%">
            <el-table-column
              type="index"
              width="50">
            </el-table-column>
            <el-table-column
              prop="code"
              label="编号"
             >
              <!--<template  slot-scope="scope">-->
                <!--<div style="position: relative">-->
                  <!--<el-select v-model="scope.row.code" :disabled="isEdit" remote @change="codeChange(scope.$index)"   :remote-method="remoteMethod"-->
                             <!--filterable="" allow-create placeholder="请输入原料编号">-->
                    <!--<el-option v-for="(item,index) in material" :disabled="(item.state && item.state.key!='NORMAL')" :key="index"-->
                               <!--:label="item.code" :value="item.no">-->
                      <!--<div style="width:100px;border-bottom:1px solid #c0c0c0;padding:5px 0px">-->
                        <!--{{item.value}}[{{item.purchaseUnit}}]-->
                      <!--</div>-->
                    <!--</el-option>-->
                  <!--</el-select>-->
                  <!--<span class="el-icon-more" @click="handleIconClick(scope.$index)"-->
                        <!--style="cursor: pointer;font-size: 10px;padding-right: 5px; position: absolute;right: 10px;top: 40%"></span>-->
                <!--</div>-->
              <!--</template>-->
            </el-table-column>
            <el-table-column
              prop="goodcode" width="150"
              label="条码">
              <template  slot-scope="scope">
                <el-tooltip class="item" effect="light" placement="bottom-start" v-if="scope.row.goodcodes && scope.row.goodcodes.length>1">
                  <div slot="content">所选品项含有多个条码:<br/>
                    <div v-for="(item,index) in scope.row.goodcodes">
                      <span>{{index+1}}、{{item}}</span>
                    </div>
                  </div>
                  <el-button  type="text" style="padding-top: 0; padding-bottom: 0">{{scope.row.goodcode}}</el-button>
                </el-tooltip>
                <span v-else>{{scope.row.goodcode}}</span><br />
              </template>
            </el-table-column>
            <el-table-column
              prop="name"
              label="名称"
              >
            </el-table-column>
            <el-table-column
              prop="spec"
              label="规格型号"
              >
            </el-table-column>
            <el-table-column
              prop="purchaseSpec"
              label="采购规格"
              >
            </el-table-column>
            <el-table-column
              prop="unitName"
              label="采购单位"
              >
            </el-table-column>
            <el-table-column
              prop="count"
              label="采购数量"
              >
            </el-table-column>
            <el-table-column
              prop="count"
              label="实收数量"
              width="100">
              <template  slot-scope="scope">
                <el-input v-model="scope.row.realCount" :disabled="isEdit" @blur="priceValidate(scope.row,'realCount')" @focus="printNum()"
                          placeholder="0.00"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              prop="price"
              label="实收单价"
              width="100">
              <template  slot-scope="scope">
                <el-input v-model="scope.row.realPrice" :disabled="isEdit" @blur="priceValidate(scope.row,'realPrice')" @focus="printNum()"
                          placeholder="0.00"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              prop="money"
              label="实收金额"
              width="100">
              <template  slot-scope="scope">
                <el-input v-model="scope.row.money" :disabled="isEdit" @blur="priceValidate(scope.row,'money')"  @focus="printNum()"
                          placeholder="0.00"></el-input>
              </template>
            </el-table-column>
            <el-table-column
              prop="historyPrice"
              label="历史采购单价"
              width="150">
              <template  slot-scope="scope">
                <span>{{scope.row.historyPrice | money}}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="unit"
              label="库存单位"
              width="150">
              <template  slot-scope="scope">
                <span>{{scope.row.unit}}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="stockCount"
              label="入库数量"
              width="150">
              <template  slot-scope="scope">
                <span>{{scope.row.stockCount | money}}</span>
              </template>
            </el-table-column>
            <el-table-column
              prop="memo"
              label="备注">
              <template  slot-scope="scope">
                <el-input v-model="scope.row.memo" :disabled="isEdit" placeholder=""></el-input>
              </template>
            </el-table-column>
          </el-table>

          </div>
          <el-row style="margin-top: 15px" class="text-left">
            <el-col :span="8">
              <el-input type="text" style="width:80%" size="medium" :disabled="true" v-model="sumOrderPrice" auto-complete="off" placeholder="请输入本单优惠金额">
                <template slot="prepend">
                  <el-button>总金额</el-button>
                </template>
              </el-input>
            </el-col>
            <el-col :span="8">
              <el-input type="text" style="width:80%"  size="medium" v-model="modelForm.giftAmount" :disabled="isEdit" auto-complete="off"   @focus="printNum()"   @blur="isDouble(modelForm,'giftAmount');calcPrice()"
                        placeholder="优惠金额">
                <template slot="prepend">
                  <el-button>优惠金额</el-button>
                </template>
              </el-input>
            </el-col>
            <el-col :span="8">
              <el-input type="text" style="width:80%"  size="medium" v-model="modelForm.payAmount" :disabled="isEdit" auto-complete="off"  @focus="printNum()"  @blur="isDouble(modelForm,'payAmount');calcPrice()"
                        placeholder="实付款金额">
                <template slot="prepend">
                  <el-button>实付款金额</el-button>
                </template>
              </el-input>
            </el-col>
          </el-row>
        </div>

      </el-form>
      <!--<el-dialog title="选择物料" :visible.sync="dialogTableVisible"  :close-on-click-modal="false"-->
      <!--:before-close="handleClose">-->
      <!--<div style="margin-left: 15px;">-->
      <!--<br>-->
      <!--<div class="text-left">-->
      <!--<el-input placeholder="请输入内容" style="width: 300px" v-model="inputText" size="medium">-->
      <!--<el-button slot="append" icon="el-icon-search" @click="inputClick"></el-button>-->
      <!--</el-input>-->
      <!--</div>-->
      <!--<el-row style="margin-top: 20px">-->
      <!--<el-col :span="5" style="height: 100%">-->
      <!--<el-tree-->
      <!--:data="data"-->
      <!--:props="defaultProps"-->
      <!--accordion-->
      <!--style="height: 400px;overflow-y: auto;background-color: rgb(238, 241, 246);color: #000000;"-->
      <!--node-key="id"-->
      <!--:default-expanded-keys="[2]"-->
      <!--:expand-on-click-node="true"-->
      <!--@node-click="handleNodeClick">-->
      <!--</el-tree>-->
      <!--</el-col>-->
      <!--<el-col :span="17" style="margin-left: 25px;">-->
      <!--<el-table :data="gridData"-->
      <!--border-->
      <!--style="height:400px;overflow-y: auto;"-->
      <!--ref="multipleTable"-->
      <!--@cell-click="chnageGoodState"-->
      <!--@selection-change="handleSelectionChange">-->
      <!--<el-table-column-->
      <!--type="selection"-->
      <!--:selectable='checkboxInit'-->
      <!--width="55">-->
      <!--</el-table-column>-->
      <!--<el-table-column property="no" label="编号"></el-table-column>-->
      <!--<el-table-column property="name" label="名称"></el-table-column>-->
      <!--<el-table-column property="goodsSpec" label="规格"></el-table-column>-->
      <!--&lt;!&ndash;<el-table-column property="unit.id" label="采购单位ID" style="display: none"></el-table-column>&ndash;&gt;-->
      <!--<el-table-column property="purchaseUnit" label="采购单位"></el-table-column>-->
      <!--<el-table-column property="unit" label="库存单位"></el-table-column>-->
      <!--<el-table-column property="purchaseSpec" label="采购规格"></el-table-column>-->
      <!--</el-table>-->
      <!--</el-col>-->
      <!--</el-row>-->
      <!--<br>-->
      <!--<div class="text-center">-->
      <!--<el-pagination-->
      <!--@size-change="handleSizeChange"-->
      <!--@current-change="handleCurrentChange"-->
      <!--:current-page.sync="currentPage3"-->
      <!--:page-sizes="pageSizeSet"-->
      <!--:page-size="pageSize"-->
      <!--layout="total, sizes, prev, pager, next, jumper"-->
      <!--:total="pageTotal">-->
      <!--</el-pagination>-->
      <!--</div>-->
      <!--</div>-->
      <!--<span slot="footer" class="dialog-footer">-->
      <!--<el-button @click="dialogTableVisible = false">取 消</el-button>-->
      <!--<el-button type="primary" @click="tableClick">确 定</el-button>-->
      <!--</span>-->
      <!--</el-dialog>-->
    </div>
    <!--<materials-select :isShow="dialogTableVisible"  v-on:pushData="getData" v-on:closeDialog="dialogTableVisible=false"></materials-select>-->
  </div>
</template>
<script>
  //注意路径
  import materialsSelect from "@/components/materialsSelect.vue"
  export default {
    data() {
      return {
        sumOrderPrice:0,
        dialogTableVisible: false,
        isEdit: false,
        type:1,
        tableData: [{
          id: "",
          code: '',
          name: '',
          goodsSpec: '',
          purchaseSpec: '',
          unitName: '',
          count: '0',
          price: '0.00',
          historyPrice: '',
          money: '0.00',
          memo: '',
        realCount:"0.00",realPrice:"0.00"}],

        modelForm: {
          createAt:""
        },
        currentPage3:3,
        pageSizeSet: window.pageSizes,
        pageSize: window.pageSize,
        pageTotal: 10,
        material: [],
        supplier: "",
        content: "",
        warehouse: "",
        suppliers: [],
        warehouses: [],
        restaurants: [],
        timeout: null,
        gridData: [],
        itemActive: 0,
        data: [],
        selectRow: [],
        inputText: "",
        defaultProps: {
          children: 'children',
          label: 'label'
        },
        pickerOptions0: {
          disabledDate(time) {
            return time.getTime() < Date.now() - 8.64e7;
          }
        },
        storeList:[]
      }
    },
    components: {
      materialsSelect
    },
    created() {
      window.this = this;
      window.isload = true;
      this.initData();
    },
    mounted() {
      if (this.$route.query.type != null && this.$route.query.type != "") {
        if (this.$route.query.type == "5") {//5 说明是查看
          $("input").attr("disabled", true);
          $(".text-left1").css("display", "none");
          $(".text-left5").css("display", "block");
          this.isEdit = true;
        }
      }
    },
    methods: {
      isDouble(item,key){
        // var isNum=/^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
        var isNum=/^\d+(\.{0,1}\d+){0,1}$/
        if(!isNum.test(item[key])){
          item[key]="0.00"
        }else{
          item[key]=item[key]
        }
      },
      //页面第一次进来获取表单需要的数据
      initData() {
        var id = this.$route.query.id;
        var query = "";
        if (id != null && id != "") {
          query = "?id=" + id;
          this.modelForm.id = id;
        }
        this.$axios.get("stores/purchaseOrders/create" + query).then((data)=> {
          if (data.status == 200) {
            let json = data.content;
            //初始化单据到表单
            this.modelForm = json.purchaseOrder;
            this.modelForm.acceptTime=this.moment().format("YYYY-MM-DD");
            this.suppliers = json.suppliers;
            this.warehouses = json.warehouses;
            this.storeList = json.storeList;
            if (id != null && id != "") {
              this.material=json.materials;
              this.modelForm.supplier = json.purchaseOrder.supplierId;
              this.modelForm.address = json.purchaseOrder.address;
              this.modelForm.remark = json.purchaseOrder.remark;
              for (var i = 0; i < json.detailList.length; i++) {

                json.detailList[i].price = (json.detailList[i].price * 1).toFixed(2);
                json.detailList[i].money = (json.detailList[i].money * 1).toFixed(2);
                json.detailList[i].unitName = json.detailList[i].purchaseUnit;
                json.detailList[i].purchaseSpec = json.detailList[i].purchaseSpec;
                json.detailList[i].spec = json.detailList[i].spec;
                json.detailList[i].money = (json.detailList[i].amount*1).toFixed(2) ;
                json.detailList[i].id = json.detailList[i].specId;
                json.detailList[i].name = json.detailList[i].name;
                json.detailList[i].realCount= json.detailList[i].count;
                json.detailList[i].realPrice=json.detailList[i].price;
                json.detailList[i].memo=json.detailList[i].remark;

                json.detailList[i].purchaseNewPrice = json.detailList[i].historyPrice ;
                if(json.detailList[i].code && json.detailList[i].code!=''){
                  if(json.detailList[i].code.indexOf(","+this.query+",")!=-1){
                    json.detailList[i].goodcode = this.query;
                  }else {
                    console.log(">VVVVVVVVVVVVVVV:",json.detailList[i].code);
                    json.detailList[i].goodcode = json.detailList[i].code.substring(1,json.detailList[i].code.indexOf(",",2));
                  }
                  json.detailList[i].code = json.detailList[i].code.substring(1,json.detailList[i].code.length-2);
                  if(json.detailList[i].code!=''){
                    json.detailList[i].goodcodes = json.detailList[i].code.split(",");
                  }
                }else{
                  json.detailList[i].goodcode="";
                  json.detailList[i].goodcodes=[];
                }
                json.detailList[i].goodcodestrs = json.detailList[i].code;
                json.detailList[i].code = json.detailList[i].no;
              }
              this.tableData = json.detailList;
            }
          } else {
            this.$message.error(data.message);
          }
        })
      },
      checkboxInit(row, index) {
        if (row.state && row.state.key != "NORMAL") {
          return 0;//不可勾选
        } else {
          return 1;
        }
      },
      handleClose(done){
        this.$emit('close');
        done();
      },
      /* 打印单据 */
      printOrder() {
        // 打印预览
        var $this = this;
        setTimeout(function () {
          $this.Print($this.$refs.printData);
        }, 200);
      },

      printNum(){
        event.currentTarget.select();
      },
      handleIconClick(index) {
        if (this.isEdit) {
          return;
        }
        this.dialogTableVisible = true;
        this.itemActive = index;
      },
      selectGood(page) {
        this.dialogTableVisible = true;
      },
      handleSizeChange(val) {
        this.pageSize = val;
        this.selectGood("");
      },
      handleNodeClick(data) {
        var id = data.id;
        this.content = "search.category.id_eq=" + id + "";
        this.selectGood("");
      },
      newLabel(newList) {
        if (newList) {
          for (var i = 0; i < newList.length; i++) {
            newList[i].label = newList[i].name;
            if (newList[i].children) {
              this.newLabel(newList[i].children)
            }
          }
        }
      },
      goBack() {
        this.router.go(-1);
      },
      calcPrice(){
        var sum=Number(this.sumOrderPrice);
        var discount=Number(this.modelForm.giftAmount);
        var recharge=Number(this.modelForm.payAmount);
        if(discount>sum){
          this.$message.error("优惠金额不能大于总金额");
          this.modelForm.giftAmount=0.00;
          return false;

        }
        if(recharge>sum){
          this.$message.error("实付金额不能大于总金额");
          this.modelForm.payAmount=0.00;
          return false;
        }
        if((discount+recharge)>sum){
          this.$message.error("输入金额有误，请重新核对");
          this.modelForm.giftAmount=0.00;
          this.modelForm.payAmount=0.00;
          return false;
        }
      },
      getSummaries(param) {
        const {columns, data} = param;
        const sums = [];
        columns.forEach((column, index) => {
          if (index === 0) {
            sums[index] = '合计';
            return;
          }
          if (index == 7 || index == 8 || index ==10 || index==13) {
            const values = data.map(item => Number(item[column.property]));
            if (!values.every(value => isNaN(value))) {
              sums[index] = values.reduce((prev, curr) => {
                const value = Number(curr);
                if (!isNaN(value)) {
                  if (index == 8) {
                    return prev + curr;
                  } else {
                    return ((prev * 1 + curr * 1) * 1).toFixed(2);
                  }
                } else {
                  if (index == 8) {
                    return prev;
                  } else {
                    return (prev * 1).toFixed(2);
                  }

                }
              }, 0);
            } else {
              sums[index] = '数据异常';
            }
          }
        });
       this.sumOrderPrice=sums[10];

        return sums;
      },
      submitForm(formName) {
        //console.log(this.tableData)
        this.type = 1;
        this.validateData(formName);
      },
      resetForm(formName) {
        this.type = 3;
        this.validateData(formName);
      },
      validateData(fromName) {
        if (this.modelForm.warehouseId == null) {
          this.$message.error("请选择入库仓库！");
          return;
        }
        for (var i = 0; i < this.tableData.length; i++) {
          if (this.tableData[i].id == "") {
            if (this.tableData.length == 1) {
              this.$message.error("请添加单据明细！");
              return;
            }
            this.tableData.splice(i, 1);
            i--;
          }
          if (this.tableData[i].realCount <= 0) {
            this.$message.error("数量不能小于1！请检查第" + (i + 1) + "行数据");
            return;
          }

        }
        if (this.tableData == null || this.tableData.length == 0) {
          this.$message.error("请添加单据明细！");
          return;
        }
        if (this.$route.query.type == "4") {//5 说明是查看
          this.modelForm.id = "";
        }
        this.$refs[fromName].validate((valid) => {
          if (valid) {
            var data = {};
            for(var i=0;i<this.warehouses.length;i++){
              if(this.modelForm.warehouseId==this.warehouses[i].id){
                this.modelForm.warehouseName=this.warehouses[i].name
              }
            }
            data.type=this.type;
            data.purchaseOrder = this.modelForm;
            var tempData=[];
            console.log(this.tableData);
            for(let i=0;i<this.tableData.length;i++){
              tempData.push({
                specId:this.tableData[i].id,
                no:this.tableData[i].code,
                name:this.tableData[i].name,
                spec:this.tableData[i].spec,
                unit:this.tableData[i].unitName,
                realCount:this.tableData[i].realCount,
                realPrice:this.tableData[i].realPrice,
                historyPrice:this.tableData[i].historyPrice,
                amount:this.tableData[i].money,
                remark:this.tableData[i].memo,
                materialSpec:this.tableData[i].goodsSpec,
                stockCount:this.tableData[i].stockCount,
                purchaseSpec:this.tableData[i].purchaseSpec,
                purchaseUnit:this.tableData[i].purchaseUnit,
                count:this.tableData[i].count,
                amount:this.tableData[i].amount,
                price:this.tableData[i].price

              })
            }
            data.details = tempData;
            this.$axios.post("stores/purchaseOrders/create", data, "json").then((data)=> {
              if (data.status == 200) {
                this.$message({
                  message: data.message,
                  type: 'success'
                });
                this.$emit('addSuccess');
                this.router.push({path: "/hqPurchaseOrders"});
              } else {
                this.$message.error(data.message);
              }
            })
          } else {
            this.$message.error("请检查输入项");
            return false;
          }
        });
      },
      priceValidate(item, key) {
        console.log(item[key]);
        var isNum = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2})))$/;
        if (!isNum.test(item[key])) {
          item[key] = "0.00"
        } else {
          item[key] = item[key]
        }
        switch (key) {
          case "realCount":
            if (!isNaN(item.realCount)) {
              item.money = item.realPrice * item.realCount;
              item.money = item.money.toFixed(2);
            } else {
              item.realCount = 0
            }
            break;
          case "realPrice":
            if (!isNaN(item.price)) {
              item.money = item.realPrice * item.realCount;
              item.money = item.money.toFixed(2);
              item.realPrice = (item.realPrice * 1).toFixed(2);
            } else {
              item.realPrice = '0.00';
            }
            break;
          case "money":
            if (!isNaN(item.money) && item.realCount > 0) {
              item.realPrice = item.money / item.realCount;
              item.realPrice = item.realPrice.toFixed(2);
              item.money = (item.money * 1).toFixed(2);
            } else {
              item.money = '0.00';
            }
            break;
        }
      },
      handleCurrentChange(item) {
        this.currentPage3 = item;
        this.selectGood(item);
      },
      addColumn(index) {
        if (this.isEdit) {
          return;
        }
        this.tableData.splice(index + 1, 0, {
          id: '',
          code: '',
          name: '',
          goodsSpec: '',
          purchaseSpec: '',
          unitId: '',
          unitName: '',
          count: '0',
          price: '0.00',
          historyPrice: '',
          money: '0.00',
          memo: '',
        })
      },
      minusColumn(index) {
        if (this.isEdit) {
          return;
        }
        if (this.tableData.length > 1) {
          this.tableData.splice(index, 1);
        } else {
          this.$message.info("最少保留一条");
        }
      },
      handleSelect(item, index) {
        //console.log(this.tableData[index])
      },
    }

  }
</script>
<style scoped>
  .el-form-item {
    margin-bottom: 10px !important;
  }

  .el-table tr {
    border-bottom: 1px solid #dfe6ec !important;
  }

  .text-left5 {
    display: none;
  }

  /*单据打印*/
  :root {
    --zoomsize: 60%;
    --line-height-set: 30px;
  }

  .print-con {
    zoom: 60%;
    width: 98%;
    color: #333333;
    font-size: 12px !important;
    background-color: #ffffff;
    padding: 0 10px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: -10;
  }

  /*单据-标题*/
  .print-con .order-title {
    zoom: var(--zoomsize);
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    padding: 5px;
    border-bottom: 2px solid #333333;
  }

  /*单据-说明信息*/
  .print-con .order-info {
    padding: 0;
    font-size: 10px !important;
    height: auto;
    overflow: hidden;
  }

  .print-con .order-info ul {
    height: auto;
    overflow: hidden;
    margin: 0;
    padding: 0;
  }

  .print-con .order-info ul li {
    list-style: none;
    font-size: 12px;
  }

  .print-con .order-info ul li {
    zoom: var(--zoomsize);
    float: left;
    width: 33%;
    height: var(--line-height-set);
    line-height: var(--line-height-set);
    overflow: hidden;
  }

  .print-con .order-info ul li.sigle-line {
    zoom: var(--zoomsize);
    width: 100%;
    display: block;
  }

  /*单据-商品列表*/
  .print-con .tb-con {
    widht: 100%;
    background-color: #b4b4b4;
    border: 1px solid #b4b4b4;
  }

  .print-con .tb-con th {
    zoom: var(--zoomsize);
    height: var(--line-height-set);
    line-height: var(--line-height-set);
    background-color: #ffffff;
    border: 1px solid #b4b4b4;
    font-size: 12px;
  }

  .print-con .tb-con td {
    zoom: var(--zoomsize);
    height: var(--line-height-set);
    line-height: var(--line-height-set);
    text-align: center;
    background-color: #ffffff; /*border: 1px solid #b4b4b4;*/
    font-size: 12px;
  }

  /*责任条款*/
  .print-con .item-info {
  }

  .print-con .item-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .print-con .item-info ul li {
    zoom: var(--zoomsize);
    height: var(--line-height-set);
    line-height: var(--line-height-set);
    font-size: 12px;
  }

</style>
